PlantGen = class(WorldGenerator)

function PlantGen:init(world,rand)
    WorldGenerator.init(self,world,rand)
end

function PlantGen:generate(x,y,z,plantId)
    while not self:isSolidBlock(x,y,z) do
        y = y - 1
    end
    local id = self:getBlock(x,y,z)
    if id == Block.soil.id or id == Block.grass.id then
        if self:isAirBlock(x,y + 1,z) then
            self:setBlock(x,y + 1,z,plantId)
        end
    end
end